﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ATM.Entities
{
    /// <summary>
    /// Class dinh nghia san du lieu dung thay the cho SQL
    /// </summary>
    public class VirtualData
    {
        #region Variables 

        public static List<Customer> CustomerList { get; set; }
        public static List<Account> AccountList { get; set; }
        public static List<ATM> AtmList { get; set; }
        public static List<Card> CardList { get; set; }
        public static List<BankOfficer> BankOfficerList { get; set; }
        public static List<Log> LogList { get; set; }
        public static List<LogType> LogTypeList { get; set; }
        public static List<Money> MoneyList { get; set; }
        public static List<OverDraft> ODList { get; set; }
        public static List<Stock> StockList { get; set; }
        public static List<WithdrawLimit> WDLimitList { get; set; } 

        #endregion

        #region Khoi tao cac gia tri
        public static void InitData()
        {
            InitCustomers();
            InitAccount();
            InitAtm();
            InitCard();
            InitMoney();
            InitStock();
        }

        public static void InitCustomers()
        {
            CustomerList = new List<Customer>
                               {
                                   new Customer
                                       {
                                           CustomerId = 1,
                                           CustomerName = "Hoang Hai",
                                           Address = "Mi dinh 2, Tu Liem, Ha Noi",
                                           Email = "hoanghainh@hotmail.com",
                                           Phone = "0975700915"
                                       },new Customer
                                           {
                                               CustomerId = 2,
                                               CustomerName = "DuongNT",
                                               Address = "Ha Tay",
                                               Email = "duongnt6@fsoft.com.vn",
                                               Phone = "01234456789"
                                           
                                           },
                                           new Customer
                                               {
                                                   CustomerId = 3,
                                                   CustomerName = "DiepNQ",
                                                   Address = "Ha Tay",
                                                   Email = "diepnq@fsoft.com.vn",
                                                   Phone = "097777777"
                                               }
                                       
                               };
        }

        public static void InitAccount()
        {
            AccountList = new List<Account>
                              {
                                  new Account
                                      {
                                          AccountId = 1201,
                                          Balance = 15000000,
                                          CustomerId = 1,
                                          OverDraftId = 1,
                                          WithdrawId = 1
                                      }, 
                                  new Account
                                      {
                                          AccountId = 1203, 
                                          Balance = 25600000,
                                          CustomerId = 1,
                                          OverDraftId = 1,
                                          WithdrawId = 1
                                      }
                              };
        }

        public static void InitAtm()
        {
            AtmList = new List<ATM>
                          {
                              new ATM
                                  {
                                      Address = "CT6 - Mi Dinh 2 - Tu Liem - Ha Noi",
                                      AtmId = 1,
                                      Branch = "VietinBank Tay Ha Noi"
                                  }
                          };
        }

        public static void InitCard()
        {
            CardList = new List<Card>
                           {
                               new Card
                                   {
                                       AccountId = 1201,
                                       CardId = "1234-2345-3456-4567",
                                       ExpireDate = new DateTime(2013, 02, 11),
                                       Pin = "123456",
                                       StartDate = new DateTime(2010, 02, 10),
                                       Status = 1
                                   },
                               new Card
                                   {
                                       AccountId = 1201,
                                       CardId = "1234-2345-3456-4677",
                                       ExpireDate = new DateTime(2013, 02, 11),
                                       Pin = "123456",
                                       StartDate = new DateTime(2010, 02, 10),
                                       Status = 1
                                   },
                               new Card
                                   {
                                       AccountId = 1201,
                                       CardId = "1344-2345-3456-4567",
                                       ExpireDate = new DateTime(2013, 02, 11),
                                       Pin = "123456",
                                       StartDate = new DateTime(2010, 02, 10),
                                       Status = 1
                                   },
                               new Card
                                   {
                                       AccountId = 1201,
                                       CardId = "1234-2355-3456-4567",
                                       ExpireDate = new DateTime(2013, 02, 11),
                                       Pin = "123456",
                                       StartDate = new DateTime(2010, 02, 10),
                                       Status = 1
                                   }
                           };
        }

        public static void InitMoney()
        {
            MoneyList = new List<Money>
                            {
                                new Money
                                    {
                                        MoneyId = 1,
                                        MoneyValue = 500000
                                    },
                                new Money
                                    {
                                        MoneyId = 2,
                                        MoneyValue = 200000
                                    },
                                new Money
                                    {
                                        MoneyId = 3,
                                        MoneyValue = 100000
                                    },
                                new Money
                                    {
                                        MoneyId = 4,
                                        MoneyValue = 50000
                                    },
                                new Money
                                    {
                                        MoneyId = 5,
                                        MoneyValue = 10000
                                    }
                            };
        }

        public static void InitStock()
        {
            StockList = new List<Stock>
                            {
                                new Stock
                                    {
                                        StockId = 1,
                                        AtmId = 1,
                                        MoneyId = 1,
                                        Quantity = 100
                                    },
                                new Stock
                                    {
                                        StockId = 2,
                                        AtmId = 1,
                                        MoneyId = 2,
                                        Quantity = 250
                                    },
                                new Stock
                                    {
                                        StockId = 3,
                                        AtmId = 1,
                                        MoneyId = 3,
                                        Quantity = 150
                                    },
                                new Stock
                                    {
                                        StockId = 4, 
                                        AtmId = 1, 
                                        MoneyId = 4,
                                        Quantity = 500
                                    }
                            };
        }
        #endregion


    }
}
